<template>
  <div class="mod-menu">
    <el-form :inline="true" :model="pamars" >
     
      <el-form-item label="手机号">
        <el-input v-model="pamars.mobile" placeholder="手机号" clearable></el-input>
      </el-form-item>
      <el-form-item>
        <el-button  @click="getDataList()"  >查询</el-button>
     
      </el-form-item>
    </el-form>
    <el-table :data="dataList" row-key="Id" border style="width: 100%; ">


        
      <el-table-column prop="name" align="center" label="姓名">
      </el-table-column>
      <el-table-column prop="mobile" align="center" label="手机号">
      </el-table-column>
     <el-table-column prop="create_time" align="center" label="时间">
      </el-table-column>
    
    </el-table>
    <el-pagination
      @size-change="sizeChangeHandle"
      @current-change="currentChangeHandle"
      :current-page="pamars.page"
      :page-sizes="[10, 20, 50, 100]"
      :page-size="pamars.limit"
      :total="totalPage"
      layout="total, sizes, prev, pager, next, jumper"
    ></el-pagination>
    <!-- 查看详情 -->
  
  </div>
</template>

<script>
  import Vue from 'vue'
  import UserDetails from './user-details'
  import MoneyDetail from './money-detail'
  import UserEdit from './user-edit.vue'
  import seviceApi from '@/api/serviceApi.js'
  import integralDetail from './integral-detail'
  export default {
    data () {
      return {
        dataForm: {},
        pamars: {
          page: 1,
          limit: 10,
          mobile: '',
          nickname: ''
        },
        totalPage: 0,
        dataList: [],
        dataListLoading: false,
        addOrUpdateVisible: false,
        moneyDetailVisible: false,
        integralVisible: false
      }
    },
    components: {
      UserDetails,
      UserEdit,
      MoneyDetail,
      integralDetail
    },
    mounted () {
      this.getList()
    },
    methods: {
      getList () {
        seviceApi.getMember(this.pamars).then(res => {
          if (res && res.data.code == 200) {
            this.dataList = res.data.page.list
            this.totalPage = res.data.page.totalCount
          }
        })
      },
      // 每页数
      sizeChangeHandle (val) {
        this.pamars.limit = val
        this.getList()
      },
      // 当前页
      currentChangeHandle (val) {
        this.pamars.page = val
        this.getList()
      },
      // 查询
      getDataList () {
        this.pamars.page = 1
        this.getList()
      },
      // updateStatus
      changeSwitch (row) {
        var param = {
          id: row.id,
          lock_status: row.lock_status
        }
        seviceApi.updateStatus(param).then(res => {
          if (res && res.data.code == 200) {
            this.$message({
              showClose: true,
              message: '修改成功',
              type: 'success'
            })
          }
        })
      },
      // 新增 / 修改
      addOrUpdateHandle (id) {
        this.addOrUpdateVisible = true
        this.$nextTick(() => {
          this.$refs.userDetails.init(id)
        })
      },
      // 查看详情
      edit (id) {
        this.$nextTick(() => {
          this.$refs.userEdit.init(id)
        })
      },
      // 查看余额
      checkBalance (id) {
        this.moneyDetailVisible = true
        this.$nextTick(() => {
          this.$refs.moneyDetail.init(id)
        })
      },
      checkIntegral (id) {
        this.integralVisible = true
        this.$nextTick(() => {
          this.$refs.integralDetail.init(id)
        })
      }
  
    }
  }
</script>
<style lang="scss">

</style>
